package com.xbongbong.paas.pojo.dto;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.PaasProcessTemplateNodeEntityExt;
import com.xbongbong.paas.enums.NodeTypeEnum;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.pro.formdata.pojo.SaasNeedRedundantAttrPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;

/**
 * @author: wufeng
 * @date: 2018/11/20 9:24
 * @desrcption: 开始流程，生成主线任务，修改流程状态，生成节点中负责人和抄送人任务
 */
@Getter
@Setter
@ToString
public class StartProcessDTO extends BaseDTO {

    private static final long serialVersionUID = 5723811255419653196L;

    @NotNull(message = "{dto.msg.startProcess.formId.NotNull}")
    private Long formId;

    @NotNull(message = "{dto.msg.startProcess.appId.NotNull}")
    private Long appId;

    @NotNull(message = "{dto.msg.startProcess.menuId.NotNull}")
    private Long menuId;

    /**
     * saas业务标记
     */
    private Integer saasMark;

    /**
     * saas业务类型
     */
    private Integer businessType;

    private Integer subBusinessType;

    /**
     * 表单数据id
     */
    private Long formDataId;

    private PaasProcessTemplateNodeEntityExt templateNode;
    /**
     * 流程状态
     */
    private Integer flowStatus;

    private String serialNo;
    /**
     * 节点类型
     */
    private Integer type;
    /**
     * 数据
     */
    private JSONObject data;

    private Integer del;

    /**
     * 拥有者id
     */
    private String ownerId;
    /**
     * 部门id
     */
    private Long departmentId;

    private Long templateId;
    @Getter(onMethod_ = {@QueryIgnore})
    private String creatorId;

    /**
     * saas所需的特殊传参pojo
     */
    private SaasNeedRedundantAttrPojo saasNeedRedundantAttrPoJo;

    private Integer stockType;

    /**
     * 1.手动创建应收模式，2.开票产生应收模式，3.出库单产生应收模式 详见ModelTypeEnum
     */
    private Long modelType;

    /**
     * 线索转换客户操作，下面的是否要将销售线索的跟进记录自动带入客户按钮
     */
    private Integer isBringCustomer;
    private Long clueId;
    /**
     * 是否是审批后置的数据
     */
    private Integer postPosition;
    /**
     * 群id，发送审批卡片到群（酷应用）
     */
    private String openConversationId;

    public StartProcessDTO(){
        del = 0;
        type = NodeTypeEnum.START_PROCESS_NODE.getNodeType();
        serialNo = "";
    }
}
